package com.sinosoft.bee.services.product.utils;

import lombok.Data;
import org.springframework.stereotype.Component;

/**
 * 数据返回实体
 * @author:Frankiegg
 * @Date:2018/5/3
 * @project:bee
 * @Modified By:
 **/
@Component
@Data
public class Result {

    /**状态码*/
    private Integer code;
    /**状态*/
    private Boolean isSuccess;
     /**消息*/
    private String message;
    /**数据对象*/
    private Object result;

    /**
     * 无参构造器
     */
    public Result(){
        super();
    }

    /**
     * 只返回状态，状态码，消息
     * @param statu
     * @param code
     * @param message
     */
    public Result(Boolean statu, Integer code, String message){
        super();
        this.isSuccess=statu;
        this.code=code;
        this.message=message;
    }

    /**
     * 只返回状态，状态码，数据对象
     * @param statu
     * @param code
     * @param result
     */
    public Result(Boolean statu, Integer code, Object result){
        super();
        this.isSuccess=statu;
        this.code=code;
        this.result=result;
    }

    /**
     * 返回全部信息即状态，状态码，消息，数据对象
     * @param statu
     * @param code
     * @param message
     * @param result
     */
    public Result(Boolean statu, Integer code, String message, Object result){
        super();
        this.isSuccess=statu;
        this.code=code;
        this.message=message;
        this.result=result;
    }
}